package com.example.appp;


import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;

import android.view.View;

public class Game extends View {
	boolean isGame;
	boolean isDead;
	Bitmap bitmapMenu;

	public Game(Context context) {
		super(context);

		isGame=false;
		bitmapMenu = BitmapFactory.decodeResource(getResources(), R.drawable.menu);
	}
	boolean newGame(){
		return isGame=true;
	}
	void finishGame(){
		System.exit(0);
	}
	void isDead (Rect pacman, Rect blinky, Rect pinky, Rect inky, Rect clyde){
		if (pacman.intersect(blinky)||
				pacman.intersect(pinky)||
					pacman.intersect(inky)||
						pacman.intersect(clyde))
			isDead=true;

	}

	@Override
	protected void onDraw(Canvas canvas) {

		canvas.drawBitmap(bitmapMenu, 0, 0, new Paint());
		super.onDraw(canvas);
	}
}
